﻿using _19.备忘录模式.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _19.备忘录模式
{
    internal class Client
    {
        public void Start()
        {
            //实例化一个游戏状态
            GameState state = new GameState();
            state.Level = 1;
            state.Exp = 99;
            state.Display();

            Manager manager = new Manager();
            manager.Backup(state);

            //修改游戏状态
            state.Level = 2;
            state.Exp = 999;
            state.Display();

            //还原游戏状态
            manager.Restore(state);
            state.Display();
        }
    }
}
